import axios from 'axios';

//设置跨域获取cookies
axios.defaults.withCredentials=true;

axios.interceptors.response.use(function (config) {
    if (config.data.code===-1)
        window.location.href=config.data.redirect;
        return config;
});